<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>踏板控制</title>
    <style>
        body {
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
            font-family: Arial, sans-serif;
        }
        button {
            width: 200px;
            height: 50px;
            margin: 10px;
            font-size: 16px;
            background-color: #007bff;
            color: white;
            border: none;
            border-radius: 10px;
        }
    </style>
</head>
<body>
    <button onclick="handlePress()">踩下踏板</button>
    <button onclick="handleRelease()">松开踏板</button>

    <script>
        function handlePress() {
            fetch('/pressPedal', { method: 'POST' })
                .then(response => response.text())
                .then(data => alert(data))
                .catch(error => console.error('Error:', error));
        }

        function handleRelease() {
            fetch('/releasePedal', { method: 'POST' })
                .then(response => response.text())
                .then(data => alert(data))
                .catch(error => console.error('Error:', error));
        }
    </script>
</body>
</html>
